package pattern.singleton.register;

/**
 * 枚举方式实现单例模式
 * 《Effective Java》推荐使用此方式实现单例
 * @author: jxj
 * @create: 2019-04-22
 **/
public enum EnumSingleton {
    INSTANCE;
    private Object data;

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
    public static EnumSingleton getInstance(){
        return INSTANCE;
    }
}
